using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _10To16
{
    class Program
    {
        static void Main(string[] args)
        {
            int ondukSan = 0, schet = 0;
          char[] array = new char[100];
            int Digit;
            int operation;

            Console.WriteLine("Enter an integer:");
            ondukSan = Convert.ToInt32(Console.ReadLine());
            while (ondukSan != 0)
            {
                Digit = Convert.ToChar(ondukSan % 16);
                operation = ondukSan % 16;

                switch (operation)
                {
                  case 0: { array[schet] = '0'; schet++; break; }
                  
                    case 1: { array[schet] = '1'; schet++; break; }
                    case 2: { array[schet] = '2'; schet++; break; }
                    case 3: { array[schet] = '3'; schet++; break; }

                    case 4: { array[schet] = '4'; schet++; break; }
                    case 5: { array[schet] = '5'; schet++; break; }
                    case 6: { array[schet] = '6'; schet++; break; }

                    case 7: { array[schet] = '7'; schet++; break; }
                    case 8: { array[schet] = '8'; schet++; break; }
                    case 9: { array[schet] = '9'; schet++; break; }

                    case 10: { array[schet] = 'A'; schet++; break; }
                    case 11: { array[schet] = 'B'; schet++; break; }
                    case 12: { array[schet] = 'C'; schet++; break; }

                    case 13: { array[schet] = 'D'; schet++; break; }
                    case 14: { array[schet] = 'E'; schet++; break; }
                    case 15: { array[schet] = 'F'; schet++; break; }
                    default: Console.WriteLine("Uuups!!"); break;
                }

                array[schet] = Convert.ToChar(Digit);
              
                ondukSan = ondukSan / 16;

                operation = ondukSan / 16;
            }


            Console.Write(" ");
            for (int i = (schet - 1); i >= 0; i--)
            {
                Console.Write(" {0}", array[i]);
            }



            Console.ReadKey();

        }
    }

}